package com.uyaer.engine.event
{
	import com.uyaer.engine.utils.HashMap;
	
	import flash.events.DataEvent;
	import flash.events.Event;
	import flash.events.EventDispatcher;

	public class EventManager
	{
		private static var dispatch:EventDispatcher = new EventDispatcher();
		/**
		 *注册事件 
		 * @param etype
		 * @param data
		 * 
		 */		
		public static function dispatchEvent(etype:String , data:Object = null):void{
			dispatch.dispatchEvent(new MyEvent(etype,data));
		}
		
		public static function addEvent(etype:String , listener:Function ,useCaputer:Boolean = false,prority:int = 0,useWeakReference:Boolean = false):void{
			dispatch.addEventListener(etype,listener,useCaputer,prority,useWeakReference);
		}
		
		public static function removeEvent(etype:String, listener:Function):void{
			dispatch.removeEventListener(etype,listener);
		}
	}
}